#include <iostream>
#include <string.h>
using namespace std;


int main(){
	int n,m;
	cin>>n>>m;
	int f[n+1][m+1];
	memset(f,0,sizeof(f));
	f[0][0] = 1;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			f[i][j] = f[i-1][j-1]+f[i-1][j]*j;
		}
	}
	
	
	cout<<f[n][m];
}
